package priv.pront.code.mati.province;

import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-11-17 10:11
 */
public class mc0202_特殊数字 {
    static int sum = 0;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] s = scanner.next().split(",");
        int a = Integer.parseInt(s[0]);
        int b = Integer.parseInt(s[1]);
        for (int i = a; i <= b; i++) {
            if (i % 2 == 0 && i % 3 == 0) {
                sum += i;
            }
        }
        System.out.println(sum);
    }
}
